import { EntitySchema } from '@mikro-orm/core';

export class ImsYzdKpQuestionData {
  id!: number;
  paperId?: number;
  questionId?: number;
  userId?: number;
  score?: number;
  zScore?: number;
  yesNum?: number;
  wrongNum?: number;
  zNum?: number;
  data?: unknown;
  paperData?: unknown;
  uniacid!: number;
  time?: string;
  useTime?: number;
}

export const ImsYzdKpQuestionDataSchema = new EntitySchema({
  class: ImsYzdKpQuestionData,
  properties: {
    id: { primary: true, type: 'number' },
    paperId: { type: 'number', nullable: true },
    questionId: { type: 'number', nullable: true },
    userId: { type: 'number', nullable: true },
    score: { type: 'number', nullable: true },
    zScore: { type: 'number', nullable: true },
    yesNum: { type: 'number', nullable: true },
    wrongNum: { type: 'number', nullable: true },
    zNum: { type: 'number', nullable: true },
    data: { type: 'unknown', columnType: 'longtext', nullable: true },
    paperData: { type: 'unknown', columnType: 'longtext', nullable: true },
    uniacid: { type: 'number', index: 'uniacid' },
    time: { type: 'string', length: 255, nullable: true },
    useTime: { type: 'number', nullable: true },
  },
});
